﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        // filter 过滤
        let arr = [11, 8, 4, 12, 5];

        let result = arr.filter((value, index, array) => {
            // console.log(value, index, array);
            if (value > 10) {
                // 该元素符合条件
                return true;
            }
        });
        console.log(result);
    </script>
</body>
</html>